/*
 * @Author: your name
 * @Date: 2021-08-07 16:37:29
 * @LastEditTime: 2021-08-10 17:42:14
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \hrsaas-86\src\api\departments.js
 */
import request from '@/utils/request'
// 获取企业部门列表
export const reqGetDepartments = () => request({ url: '/company/department' })

/**
 * 根据id删除部门
 * **/
export function reqDelDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 新增部门
export const reqAddDEpartment = data =>
  request({
    method: 'post',
    url: '/company/department',
    data
  })
// 根据id查询部门详情
export const reqGetDepartDetail = id =>
  request({ url: `/company/department/${id}` })

/**
 * 编辑部门
 ***/
export function reqUpdateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
